<template>
  <div class="data-records">
    <div class="shade"></div>
    <div class="popup">
      <div class="title justify-content-between">
        <span class="fs28 colorFFF">齐套情况</span>
        <img src="../assets/images/icon-close.png" @click="cancel" />
      </div>
      <div class="content">
        <div class="theader justify-content-between">
          <div class="w1000">序号</div>
          <div class="w3000">单机代号</div>
          <div class="w3000">单机名称</div>
          <div class="w3000">设备编号</div>
        </div>
        <div class="tbodys" v-if="listData">
          <div
            class="tbody justify-content-between"
            v-for="(item, index) in listData"
            :key="item.id"
          >
            <div class="w1000">{{ index + 1 }}</div>
            <div class="w3000">{{ item.deviceCode }}</div>
            <div class="w3000">{{ item.deviceName }}</div>
            <el-tooltip placement="bottom" effect="light">
              <div slot="content" class="fs18">{{ item.deviceNos }}</div>
              <div class="w3000 text-overflow">{{ item.deviceNos }}</div>
            </el-tooltip>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "QiSet",
  props: {
    taskData: Object,
  },
  data() {
    return {
        listData: []
    };
  },
  created() {
      this.getTaskDetail()
  },
  methods: {
    // 关闭弹窗
    cancel() {
      this.$emit("cancel");
    },
    getTaskDetail() {
      let _this = this;
      _this.axios.getTaskDetail({
        matchId: _this.taskData.matchIds
      }).then(res => {
        console.log(res)
        if (res.code == 200) {
          _this.listData = res.data.list
        }
      }).catch(function (error) {
        _this.$message.error(error.msg);
      });
    },
  },
};
</script>

<style scoped lang='less'>
@import url("../assets/css/public.css");
.data-records {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  .shade {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
  }
  .popup {
    width: 8.28rem;
    height: 4.99rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    box-shadow: 0 .05rem .15rem 0 rgba(0, 21, 54, 0.25);
    .title {
      width: 100%;
      height: .58rem;
      background-color: #285fe3;
      padding: 0 .25rem 0 .40rem;
      img {
        width: .23rem;
        height: .23rem;
        cursor: pointer;
      }
    }
    .content {
      width: 100%;
      padding: .14rem .40rem 0;
      .theader {
        width: 100%;
        height: .36rem;
        background: #f4f5f8;
        border: 1px solid #d0d6e3;
        border-radius: .03rem;
        padding: 0 0 0 .15rem;
        margin-top: .07rem;
        .triangle {
          width: 0;
          height: 0;
          border-top: .08rem solid #505971;
          border-left: .08rem solid transparent;
          border-right: .08rem solid transparent;
          margin-left: .05rem;
        }
      }
      .theader > div {
        text-align: center;
        font-size: .18rem;
        color: #505971;
      }
      .tbodys {
        width: 100%;
        max-height: 315rem;
        overflow-y: scroll;
      }
      .tbodys::-webkit-scrollbar {
        display: none;
      }
      .tbodys {
        scrollbar-width: none;
        -ms-overflow-style: none;
        overflow-x: hidden;
        overflow-y: auto;
      }
      .tbody {
        width: 100%;
        min-height: .42rem;
        border: 1px solid #d0d6e3;
        border-radius: .03rem;
        font-size: .18rem;
        color: #161d2e;
        margin-top: .03rem;
        padding: 0 0 0 .15rem;
        text-align: center;
      }
      .w1000 {
        width: 10%;
      }
      .w6000 {
        width: 60%;
      }
      .w3000 {
        width: 30%;
      }
    }
  }
}
</style>